Skip to content

docs: add branching and comment conventions to .ai/instructions.md - #306

Merged
mrafnadeem-apimatic merged 5 commits into
devfrom
worktree-claude-md-dev-branch
Aug 5, 2026
Merged

docs: add branching and comment conventions to .ai/instructions.md#306
mrafnadeem-apimatic merged 5 commits into
devfrom
worktree-claude-md-dev-branch

Conversation

@mrafnadeem-apimatic

@mrafnadeem-apimatic mrafnadeem-apimatic commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Adds two project conventions to .ai/instructions.md, where this repo keeps its conventions (CLAUDE.md only points to that file).

Branching

New ## Branching section, placed before ## Commit Conventions:

  • Always start work from dev, never main — branch from origin/dev, open PRs against dev.
  • Never commit to, branch from, or target main; stop and ask if a task appears to require it.
  • Worktrees included, with a re-base recipe.

The worktree note exists because this repo's remote default branch is beta (refs/remotes/origin/HEAD -> origin/beta), not main or dev, and the three have diverged. A newly created worktree therefore starts from beta, so the section gives git fetch origin dev && git reset --hard origin/dev (fresh, clean worktrees only) plus a verification step.

Comments

New bullet in ## Critical Code Conventions: No AI-generated comments — comment only to explain non-obvious why (a constraint, workaround, or subtle invariant); never restate the code, narrate a change, or leave notes for a future agent. Default to no comment; existing comment density nearby is never a reason to add more.

CLAUDE.md

Unchanged except one word: its pointer line now reads "architecture, conventions, branching, testing, commits" so the new section is discoverable.

Notes for reviewers

  • The branching rule routes everything to dev as requested and deliberately says nothing about targeting beta. If beta is in practice the integration branch, this rule and the repo default disagree, and the remote default may want repointing.
  • The comment rule covers code comments only. It does not address AI attribution trailers in commit messages or PR bodies; say so if those should be banned too.
  • Branch history: earlier commits put these rules in CLAUDE.md before ec02bb9 moved them here. Net diff against dev is +11 lines in .ai/instructions.md and 1 changed line in CLAUDE.md. Worth squashing on merge.

Docs-only change; no code touched.

mrafnadeem-apimatic and others added 3 commits August 5, 2026 13:09
Adds a Branching section to CLAUDE.md so agents branch from origin/dev
and open PRs against dev instead of main.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A new worktree bases off the repo default branch (beta), not dev, so
CLAUDE.md now spells out re-basing onto origin/dev before making changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Lead with the imperative (base worktrees on origin/dev) and state the
beta default as a caveat, so no sentence scans as "do not use dev".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comments must explain non-obvious why only; existing comment density in
nearby code is not a reason to add more.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mrafnadeem-apimatic mrafnadeem-apimatic changed the title docs: require starting work from dev, never main docs: add branching and comment rules to CLAUDE.md Aug 5, 2026
Project conventions belong in .ai/instructions.md; CLAUDE.md only points
to it. Adds a Branching section (start from dev, never main, worktrees
included) and a no-AI-generated-comments code convention, and reverts
CLAUDE.md to its original content.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mrafnadeem-apimatic mrafnadeem-apimatic changed the title docs: add branching and comment rules to CLAUDE.md docs: add branching and comment conventions to .ai/instructions.md Aug 5, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@mrafnadeem-apimatic
mrafnadeem-apimatic merged commit b2429e8 into dev Aug 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants